﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using BlogKickStart.Models;

namespace BlogKickStart.Controllers
{
	public class HomeController : Controller
	{
		BlogKickstartContext Database = new BlogKickstartContext();

		public ActionResult Index()
		{
			//using (var data = new BlogKickstartContext())
			//{
				IEnumerable<Blog> model = this.Database.Blogs;
				//model = data.Blogs.AsEnumerable<Blog>();
				
				ViewBag.Message = "Welcome to the Blog Kickstart Project!";

				return View(model);
			//}
		}

		[HttpPost]
		public ActionResult Index(IEnumerable<Blog> model)
		{
			return View(model);
		}

		public ActionResult About()
		{
			return View();
		}
	}
}
